filename = ARGV.first
script = $0

puts "Erase file #{filename}."
puts "To cancel, hit CTRL-C."
puts "To continue, hit ENTER"

print "?"
STDIN.gets

puts "Open the file ..."
target = File.open(filename, "w")

puts "Deleting file....."
target.truncate(target.size)
puts "Done"

puts "Hit 3 line"

print "line 1:\t"; line1 = STDIN.gets.chomp()
print "line 2:\t"; line2 = STDIN.gets.chomp()
print "line 3:\t"; line3 = STDIN.gets.chomp()

puts "Write to file"
target.write(line1)
target.write("\n")
target.write(line2)
target.write("\n")
target.write(line3)
target.write("\n")
puts "Done"
target.close()